package Test;


import java.util.Arrays;
import java.util.Scanner;

public class Test{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
       while(in.hasNextInt()){
           int count= in.nextInt();
           long[] arr = new long[3*count];
           for (int i = 0; i <3*count ; i++) {
               arr[i]=in.nextLong();
           }
           Arrays.sort(arr);
           long sum = 0;
           for (int i = 0; i <count ; i++) {
               sum+=arr[arr.length-(2*(i+1))];

           }
           System.out.println(sum);
       }

    }


}
